package com.example.administrator.appjiamzhi;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;

/**
 * Created by Administrator on 2016/12/28.
 */

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

/**
 * Created by Administrator on 2016/12/27 0027.
 */

public class zhuce extends zhuye {
    private EditText zEditText,mEditText,yEditText;
    private Button hButton,tButton;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.zhuce);
        initView();

    }
    public void initView() {
        zEditText = (EditText) findViewById(R.id.zhucezhanhao);
        mEditText = (EditText)findViewById(R.id.zhucezhucdshurumima);
        yEditText = (EditText)findViewById(R.id.yanzhenma);
        hButton = (Button)findViewById(R.id.huoquyanzhenma);
        tButton = (Button)findViewById(R.id.tijiao);
        tButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String zhanghaoText = zEditText.getText().toString();
                String mimaText = mEditText.getText().toString();
                String yangzhenText = yEditText.getText().toString();
                if (zhanghaoText.equals("")) {
                    Toast.makeText(zhuce.this,"账号不能为空",Toast.LENGTH_LONG).show();
                    return;
                }
                if (mimaText.equals("")) {
                    Toast.makeText(zhuce.this,"密码不能为空",Toast.LENGTH_LONG).show();
                    return;
                }
                if (yangzhenText.equals("")) {
                    Toast.makeText(zhuce.this,"验证码不能为空",Toast.LENGTH_LONG).show();
                    return;
                }
                Toast.makeText(zhuce.this,"注册成功",Toast.LENGTH_LONG).show();
                Intent intent = new Intent(zhuce.this,denglu.class);
                startActivity(intent);

            }
        });
    }
}
